home *** CD-ROM | disk | FTP | other *** search
-
-
-
- Bit C Library Procedures Bit
-
-
-
- _________________________________________________________________
-
- NNAAMMEE
- Bit_Set, Bit_Clear, Bit_IsSet, Bit_IsClear, Bit_Copy,
- Bit_Zero, Bit_FindFirstSet, Bit_FindFirstClear,
- Bit_Intersect, Bit_Union, Bit_AnySet, Bit_Expand, Bit_Alloc,
- Bit_Free - bit operations
-
- SSYYNNOOPPSSIISS
- #include <bit.h>
-
- BBiitt__SSeett(_b_i_t_N_u_m, _a_r_r_a_y_P_t_r)
-
- BBiitt__CClleeaarr(_b_i_t_N_u_m, _a_r_r_a_y_P_t_r)
-
- BBiitt__IIssSSeett(_b_i_t_N_u_m, _a_r_r_a_y_P_t_r)
-
- BBiitt__IIssCClleeaarr(_b_i_t_N_u_m, _a_r_r_a_y_P_t_r)
-
- BBiitt__CCooppyy(_n_u_m_B_i_t_s, _s_r_c_A_r_r_a_y_P_t_r, _d_e_s_t_A_r_r_a_y_P_t_r)
-
- BBiitt__ZZeerroo(_n_u_m_B_i_t_s, _a_r_r_a_y_P_t_r)
-
- BBiitt__FFiinnddFFiirrssttSSeett(_n_u_m_B_i_t_s, _a_r_r_a_y_P_t_r)
-
- BBiitt__FFiinnddFFiirrssttCClleeaarr(_n_u_m_B_i_t_s, _a_r_r_a_y_P_t_r)
-
- Boolean
- BBiitt__IInntteerrsseecctt(_n_u_m_B_i_t_s, _a_r_r_a_y_1_P_t_r, _a_r_r_a_y_2_P_t_r, _d_e_s_t_A_r_r_a_y_P_t_r)
-
- Boolean
- BBiitt__UUnniioonn(_n_u_m_B_i_t_s, _a_r_r_a_y_1_P_t_r, _a_r_r_a_y_2_P_t_r, _d_e_s_t_A_r_r_a_y_P_t_r)
-
- Boolean
- BBiitt__AAnnyySSeett(_n_u_m_B_i_t_s, _a_r_r_a_y_P_t_r)
-
- int *
- BBiitt__EExxppaanndd(_n_e_w_N_u_m_B_i_t_s, _o_l_d_N_u_m_B_i_t_s, _o_l_d_A_r_r_a_y_P_t_r)
-
- BBiitt__AAlllloocc(_n_u_m_B_i_t_s, _a_r_r_a_y_P_t_r)
-
- BBiitt__FFrreeee(_a_r_r_a_y_P_t_r)
-
- AARRGGUUMMEENNTTSS
- int _b_i_t_N_u_m (in) The number in the array
- of the bit to manipulate.
-
- int _n_u_m_B_i_t_s (in) The number of bits in all
- the *_a_r_r_a_y_P_t_r variables
- passed.
-
- int *_a_r_r_a_y_P_t_r (in,out) The array of bits.
-
-
-
- Sprite v.1.0 Printed: January 31, 1989 1
-
-
-
-
-
-
- Bit C Library Procedures Bit
-
-
-
- int *_s_r_c_A_r_r_a_y_P_t_r (in) The array of bits to be
- copied.
-
- int *_d_e_s_t_A_r_r_a_y_P_t_r (out) The array to which bits
- are copied.
-
- int *_a_r_r_a_y_1_P_t_r (in) The first source array in
- an intersection or union
- operation.
-
- int *_a_r_r_a_y_2_P_t_r (in) The second source array
- in an intersection or
- union operation.
-
- int _n_e_w_N_u_m_B_i_t_s (in) The number of bits the
- expanded array must hold.
-
- int _o_l_d_N_u_m_B_i_t_s (in) The number of bits in the
- old array.
-
- int *_o_l_d_A_r_r_a_y_P_t_r (in) The bit array that is now
- too small.
-
- _________________________________________________________________
-
- DDEESSCCRRIIPPTTIIOONN
- These procedures manipulate integer arrays of bits. All the
- procedures operate on integer arrays and _n_u_m_B_i_t_s is used to
- compute the size of *_a_r_r_a_y_P_t_r. If _n_u_m_B_i_t_s is not a multiple
- of the number of bits in an integer, it is rounded up to the
- nearest multiple.
-
- BBiitt__SSeett sets the _b_i_t_N_u_m bit in *_a_r_r_a_y_P_t_r.
- BBiitt__CClleeaarr clears the _b_i_t_N_u_m bit in *_a_r_r_a_y_P_t_r.
-
- The predicates BBiitt__IIssSSeett and BBiitt__IIssCClleeaarr test to see if the
- _b_i_t_N_u_m bit is set or cleared.
-
- BBiitt__ZZeerroo clears all bits in *_a_r_r_a_y_P_t_r.
- BBiitt__CCooppyy copies *_s_r_c_A_r_r_a_y_P_t_r to *_d_e_s_t_A_r_r_a_y_p_t_r.
-
- BBiitt__FFiinnddFFiirrssttSSeett and BBiitt__FFiinnddFFiirrssttCClleeaarr return the index of
- the rightmost bit in *_a_r_r_a_y_P_t_r that is set or cleared. The
- index begins at 0 and -1 is returned if no set or cleared
- bit is found.
-
- BBiitt__IInntteerrsseecctt and BBiitt__UUnniioonn find the intersection and union,
- respectively, of the two bit arrays and stores the result in
- the third array. They return TRUE if the intersection or
- union is non-empty. For both functions, if _d_e_s_t_A_r_r_a_y_P_t_r is
- NULL, the result is not stored anywhere.
-
- BBiitt__AAnnyySSeett examines the array to see if any of the bits is
- on, returning TRUE if at least one is set and FALSE
-
-
-
- Sprite v.1.0 Printed: January 31, 1989 2
-
-
-
-
-
-
- Bit C Library Procedures Bit
-
-
-
- otherwise.
-
- BBiitt__AAlllloocc and BBiitt__FFrreeee are used to allocate and free bit
- arrays. BBiitt__AAlllloocc creates an array to hold _n_u_m_B_i_t_s bits and
- sets _a_r_r_a_y_P_t_r to point at it. The array initially has no
- bits set. BBiitt__FFrreeee deallocates a previously-allocated bit
- array.
-
- BBiitt__EExxppaanndd takes an existing, dynamically-allocated array,
- _o_l_d_A_r_r_a_y_P_t_r, along with its width, _o_l_d_N_u_m_B_i_t_s, and expands
- it to contain _n_e_w_N_u_m_B_i_t_s bits, returning a pointer to the
- expanded array. The array may or may not have moved. If the
- array was moved, the old array was deallocated at the same
- time. The new bits are initially all 0.
-
- KKEEYYWWOORRDDSS
- bit, set, clear, copy, zero
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Sprite v.1.0 Printed: January 31, 1989 3
-
-
-
-